﻿<%@page import="cn.jdy.common.constant.GlobalConstant"%>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="jdy" uri="http://www.qwe.com.cn/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>康养旅居宝</title>
      <jsp:include page="../common/common.jsp"/>
     
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <style type="text/css">
.dateil h4 {
	border: 0;
}

.dateil {
	margin-top: 0;
	border-bottom: 0;
	border-top: 1px solid #F3F3F3;
}

.day {
	display: flex;
	padding: 0.5rem 1rem;
	justify-content: space-between;
}
.day  {
	display: flex;
	padding: 0.5rem 1rem;
	justify-content: space-between;
}

</style>
</head>
<body>
    <div class="main" >
        <div class="apartList"  >
            <li>
                <img src="${data.imgUrl}" alt="">
                
                <div class="dateils">
                    <p>${data.title}</p>
                 <c:if test="${data.ispktype!=1}">   <p>${data.province}</p>
               <p>${data.houses}居/${data.square}平米/宜住${data.yzrs}人</p>  </c:if>   
                    <p></p>
                </div>
            </li>
        </div>
   	 <c:if test="${data.ispktype!=1}">
<div class="dateil" >
			<h5>
				<b>使用方式：</b>
				 				<c:if test="${data.isfb eq '0'}">
			                                随时使用
			                                </c:if>
			                                   <c:if test="${data.isfb eq '1'}">
			                              到期使用
			                                </c:if>	
			                                
	     			<input type="hidden"  id="isfb"   value="${data.isfb}">
	     			  			<input type="hidden"  name="istqsr"   value="${data.isfb}">
	     				
			</h5>
			<br />
			
			
			<div class="tip">使用请七天前联系客服</div>
		</div>
		<c:if test="${data.isfb eq '1'}">
		<div class="dateil day">
			<h5 style="margin: 0">提前预定:</h5>
			<div  >
				<ul class="time1"   >
			
				  
				 <li>${data.refund}天</li>
				 			        <input type="hidden"  id="rzts"   value="365">	
   	 								 <input type="hidden"  id="rzsj"   value="365">	
				
				</ul>
			</div>
		</div>
	
		
		<div class="dateil day">
			<h5>
				<b>到期时间：</b>
				${datime}
		 <input type="hidden"  id="dqtime"  name="dqtime"  value="${datime}">	
				
				
			</h5>
		</div>
		<div class="dateil day">
			<h5>
				<b>预期奖励红包：</b>
			
				 
			     
			  <span id="yjjfs">
			                      <fmt:formatNumber type="number" value="${data.lv*data.reduceprice/365*data.refund}" pattern="0.00"/> 
			        </span>
			         <input type="hidden"  id="jljf"   value="<fmt:formatNumber type="number" value="${data.lv*data.reduceprice/365*data.refund}" pattern="0.00"/>">	
				元
			</h5>
		</div>
		 </c:if>
		 <c:if test="${data.isfb eq '0'}">
		 	<div class="dateil day">
			<h5>
				<b>预计奖励红包：</b>
			                    	<span id="yjjfs">
			                      <fmt:formatNumber type="number" value="${data.lv*data.reduceprice/365*360}" pattern="#.00"/> 
			        </span>
			         <input type="hidden"  id="jljf"   value="<fmt:formatNumber type="number" value="${data.lv*data.reduceprice/365*365}" pattern="0.00"/>">	
				元
 
			</h5>
		</div>
		     </c:if>	
		     
		     	</c:if>
			
		<div class="dateil day">
			<h5 style="margin: 0">购买份数：</h5>
			<div>
			 <c:if test="${data.ispktype!=1}"> <button onclick="jiasyi()">-</button></c:if>
				<input type="text"   disabled="disabled"   name="fs"  id="mershu" value="1" />
					 <c:if test="${data.ispktype!=1}">	<button onclick="jiashul()">+</button></c:if>
			</div>
 
		</div>
	
	      <c:if test="${data.ispktype!=1}"> 	<div class="dateil day">
			<h5 style="margin: 0">快捷购买</h5>
			<div>
				<ul class="time1">
					<li  onclick="opensea(30)">30份</li>
					<li onclick="opensea(60)">60份</li>
					<li onclick="opensea(100)">100份</li>
				</ul>
			</div>
								
		</div></c:if>
		<c:if test="${2 eq data.rmtype}">
		<div class="dateil day">
				<div class="tip">新手专区活动，满1000减免58，满2000减免128，满5000减免388。</div>
		 
				 
	 
			</div>
		</c:if>
	</div>
    <ul class="buttom orderconfirm">
        <li class="price"><s>	     
  		 
        </s>
			总价：￥ <span  id="zj">
		${data.reduceprice}
			</span>元
			<input type="hidden"  id="reduceprice"   value="${data.reduceprice}">	
			</li>
        <li class="now"  onclick="wxprepaydodashng(${data.id},${data.mallId}) " ><a href="#"  >提交订单</a></li>
    
    </ul>
    <input type="hidden"  id="isfirst"   value="${isfirst}">
    <input type="hidden"  id="rmtype"   value="${data.rmtype}">	
    
</body>
 <script src="${path}/js/jquery-3.2.1.min.js"></script>
<script src="${path}/js/swiper.min.js"></script>
<script src="${path}/js/swiperTab.js"></script>
<script src="${path}/js/orderds.js"></script>
<script src="${path}/js/swiper.min.js"></script>
<script>
 


function jiashul(){
	var yj=$("#yjjfs").text()/$("#mershu").val(); //单价积分
	var yjzj=$("#zj").text()/$("#mershu").val(); //单价
    $("#mershu").val($("#mershu").val()*1+1);
  
 // var yj=$("#yjjfs").text();
 	var de= yj*$("#mershu").val();
 
    //var index2 = de.indexOf(".");
    if(de>0){
      	$("#yjjfs").text(de.toFixed(2));// 预计积分
	    $("#jljf").val(de.toFixed(2));// 预计积分
	    
    }else{
      	$("#yjjfs").text(de);// 预计积分
	    $("#jljf").val(de);// 预计积分
    }
  
    
    
    
    
	var de2= yjzj*$("#mershu").val();
 
    if(1000<de2&&de2<2000){
    	de2=de2-58;
    }  else if(2000<=de2&&de2<5000){
    	de2=de2-128;
    } else  if(5000<=de2){
    	de2=de2-388;
    }
    $("#zj").text(de2.toFixed(2)); // 预计总价
    $("#reduceprice").val(de2.toFixed(2)); // 预计总价
  //  var index = de2.indexOf(".");
    if(de2>0){
        $("#zj").text(de2.toFixed(2)); // 预计总价
	    $("#reduceprice").val(de2.toFixed(2)); // 预计总价
    }else{
    	   $("#zj").text(de2); // 预计总价
		    $("#reduceprice").val(de2); // 预计总价
    }
}

function jiasyi(){
	var me=$("#mershu").val();
  if(me>1){
		var yj=$("#yjjfs").text()/$("#mershu").val(); //单价积分
		var yjzj=$("#zj").text()/$("#mershu").val(); //单价
	 //   var index2 = de.indexOf(".");
	    if(de>0){
	      	$("#yjjfs").text(de.toFixed(2));// 预计积分
		    $("#jljf").val(de.toFixed(2));// 预计积分
		    
	    }else{
	      	$("#yjjfs").text(de);// 预计积分
		    $("#jljf").val(de);// 预计积分
	    }
	  
		
		
		
	  $("#mershu").val(me*1-1);
	  var de= yj*$("#mershu").val();
	  //  var index2 = de.indexOf(".");
	    if(de>0){
	      	$("#yjjfs").text(de.toFixed(2));// 预计积分
		    $("#jljf").val(de.toFixed(2));// 预计积分
		    
	    }else{
	      	$("#yjjfs").text(de);// 预计积分
		    $("#jljf").val(de);// 预计积分
	    }
	  
	
	    
	    
		var de2= yjzj*$("#mershu").val();
	    if(1000<de2&&de2<2000){
	    	de2=de2-58;
	    }  else if(2000<=de2&&de2<5000){
	    	de2=de2-128;
	    } else  if(5000<=de2){
	    	de2=de2-388;
	    }
	
	    
	 //   var index = de2.indexOf(".");
	    if(de2>0){
	        $("#zj").text(de2.toFixed(2)); // 预计总价
		    $("#reduceprice").val(de2.toFixed(2)); // 预计总价
	    }else{
	    	   $("#zj").text(de2); // 预计总价
			    $("#reduceprice").val(de2); // 预计总价
	    }
  }
  
}

function opensea(sr){
	var yj=$("#yjjfs").text()/$("#mershu").val(); //单价积分
	var yjzj=$("#zj").text()/$("#mershu").val(); //单价

	 var de= yj*sr;
	  $("#yjjfs").text(de.toFixed(2));// 预计积分
	    $("#jljf").val(de.toFixed(2));// 预计积分
	      

		var de2= yjzj*sr;
	    
	    if(1000<de2&&de2<2000){
	    	de2=de2-58;
	    }  else if(2000<=de2&&de2<5000){
	    	de2=de2-128;
	    } else  if(5000<=de2){
	    	de2=de2-388;
	    }
	 //   var index = de2.indexOf(".");
	    if(de2>0){
	        $("#zj").text(de2.toFixed(2)); // 预计总价
		    $("#reduceprice").val(de2.toFixed(2)); // 预计总价
		    
		
	    }else{
	    	   $("#zj").text(de2); // 预计总价
			    $("#reduceprice").val(de2); // 预计总价
	    }
	
	    $("#mershu").val(sr);

}
//减的效果
 
</script>
</html>
 

